/*
****************************************************************************************
* @FilePath     : platform_uart.h
* @brief        : 
* @author       : L0131 - guomingpeng 952856693@qq.com
* @attention    : Copyright (c) 2024 awptech.co.ltd. All rights reserved.
****************************************************************************************
*/
#ifndef _PLATFORM_UART_H_
#define _PLATFORM_UART_H_
#ifdef __cplusplus
extern "C"
{
#endif
#include <stdint.h>
#include "usart.h"

typedef void (*recv_callback)(uint8_t *, uint16_t);

typedef struct 
{
    uint8_t *buf;
    uint16_t last_cndtr;
    uint16_t buf_index;
    uint16_t recv_len;
    recv_callback recv_callback;
}plf_uart_t;

int32_t plf_uart3_init(void);
int32_t plf_uart3_deinit(void);
int32_t plf_uart3_send_sync(uint8_t *p_data, uint16_t length);
int32_t plf_uart3_recv_sync(uint8_t *p_data, uint16_t length);
int32_t plf_uart3_send_async(uint8_t *p_data, uint16_t length);
int32_t plf_uart3_recv_async(uint8_t *p_data, uint16_t length);
int32_t plf_uart3_recv_callback_register(void *func);

#ifdef __cplusplus
}
#endif
#endif	/* _PLATFORM_UART_H_ */
